package org.glorylight.hacks.social.service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

public abstract class BaseService {
	
	@PersistenceContext
	protected EntityManager em;
	
	protected void add(Object o) throws Exception {
		em.persist(o);
		em.flush();
	}
	
	protected void delete(Object o) throws Exception {
		em.remove(o);
		em.flush();
	}
	
	protected void update(Object o) throws Exception {
		em.persist(o);
		em.flush();
	}
}
